package com.qianfeng.biquge.mapper;

import com.qianfeng.biquge.pojo.Categories;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface CategorieMapper {

    @Insert("insert into categories(categoryname) value(#{categoryName} )")
    void addCategorie(@Param("categoryName") String categoryName);

    @Select("select * from categories where datastatus=0")
    List<Categories> getAllOKCategorie();

    @Select("select * from categories where datastatus=1")
    List<Categories> getAllCategorieIsDelete();


    int updateCategorie( Categories categories);

    @Delete("delete from categories where categoryid=#{categoryId} ")
    int deleteCategorie(@Param("categoryId") Long categoryId);

    @Select("select * from categories where categoryname=#{categoryname} ")
    Categories getCategorieByCategoryName(@Param("categoryname") String categoryname);

    @Select("select * from categories where categoryid=#{categoryid} ")
    Categories getCategorieByCategoryId(@Param("categoryid") Long categoryid);


}
